{include file="common/head"/}
<style>
    .layui-table-cell{height: auto;}
    .layui-table-cell ul li a{color: #1C8FEF;display: block;border: 1px solid #ececec;padding: 3px 8px;}
    .layui-table-cell ul li a:hover{color: #005580}
</style>
<div class="admin-main layui-anim layui-anim-upbit">
    <fieldset class="layui-elem-field layui-field-title">
        <legend>录入列表</legend>
    </fieldset>

    <table class="layui-table" id="list" lay-filter="list"></table>
    <div class="layui-form-item" style="margin-left: -110px;">
        <div class="layui-input-block">
            <a href="{:url('index')}" class="layui-btn layui-btn-primary">{:lang('back')}</a>
        </div>
    </div>
</div>
</div>

{include file="common/foot"/}

<script type="text/html" id="status">
    {{# if(d.entry_submit_status==2){ }}
    <span class="layui-btn layui-btn-xs layui-btn-danger">已提交</span>
    {{# }else if(d.entry_submit_status==1){ }}
    <span class="layui-btn layui-btn-xs">保存待提交</span>
    {{# }else if(d.entry_submit_status==0){ }}
    <span class="layui-btn layui-btn-xs">待处理</span>
    {{# }else{ }}
    {{d.entry_submit_status}}
    {{# } }}
</script>
<script type="text/html" id="barDemo">
    {{# if(d.submit_status=='2'){ }}
    <a class="layui-btn  layui-btn-xs layui-btn-disabled" >录入</a>
    {{# }else{ }}
    <a class="layui-btn  layui-btn-xs " lay-event="submit">录入</a>
    {{# } }}
</script>
<script>
    layui.use(['table','element','laydate','form'], function() {
        var table = layui.table, form = layui.form, $ = layui.jquery,laydate = layui.laydate;

        var tableIn = table.render({
            id: 'user',
            elem: '#list',
            url: "{:url('entry_teacher')}?teacher_id="+{$teacher_id},
            method: 'post',
            page: true,
            even:true,
            cols: [[
                {field: 'title',title: '考核项分类名称', width: 150},
                {field: 'entry_submit_status',title: '录入状态', width: 150,templet:'#status'},
                {width: 160, align: 'center', toolbar: '#barDemo'}
            ]],
            limit: 10 //每页默认显示的数量
        });

        table.on('tool(list)', function(obj){
            var data = obj.data;
            if(obj.event === 'submit') {
                location.href = "{:url('entry_teacher_show')}?teacher_id="+{$teacher_id}+"&cate_id="+data.cate_id;
            }

        });

    });
</script>
</body>
</html>